﻿@model IEnumerable<Comercio.Models.DBM.tb_proveedor>

@{
    ViewBag.Title = "Administrar proveedores";
}

<h2>Administrar proveedores</h2>

<p>
    @Html.ActionLink("Ingresar nuevo proveedor", "Create")
</p>
<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.rut_proveedor)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.razon_social)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.telefono)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.direccion)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.email)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.contacto)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.rut_proveedor)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.razon_social)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.telefono)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.direccion)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.email)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.contacto)
        </td>
        <td>
            @Html.ActionLink("Editar", "Edit", new { id=item.rut_proveedor }) |
            @Html.ActionLink("Detalles", "Details", new { id=item.rut_proveedor }) |
            @Html.ActionLink("ELiminar", "Delete", new { id=item.rut_proveedor })
        </td>
    </tr>
}

</table>
<div>
    @Html.ActionLink("Volver", "Admin", "Home")
</div>